package org.wdzl;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;

/**
 * @author ww
 * 启动方式二： 外部tomcat启动项目
 */
@SpringBootApplication
@MapperScan(value = "org.wdzl.mapper")
@ComponentScan(basePackages = {"org.wdzl","org.n3r.idworker"})
public class OuterStartApplication extends SpringBootServletInitializer {

    @Bean
    public SpringUtil getSpringUtil(){
        return new SpringUtil();
    }

    @Override
    protected SpringApplicationBuilder configure(SpringApplicationBuilder builder) {
        return builder.sources(OuterStartApplication.class);
    }

    public static void main(String[] args) {
        SpringApplication.run(OuterStartApplication.class, args);
    }

}
